import java.util.concurrent.Semaphore;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2023-02-09
 * Time: 15:16
 */
public class test6 {
    public static void main(String[] args) throws InterruptedException {
        //创建信号量
        Semaphore semaphore=new Semaphore(4);
        //P操作，申请资源，计数器-1
        semaphore.acquire();
        //V操作，释放资源，计数器+1
        semaphore.release();
    }
}
